package com.tobby.camelinaction.orderrouter;

import org.apache.camel.builder.RouteBuilder;

/**
 * A Camel Java DSL Router
 */
public class MyRouteBuilder extends RouteBuilder {

	/**
	 * Let's configure the Camel routing rules using Java code...
	 */
	public void configure() {

		// here is a sample which processes the input files
		// (leaving them in place - see the 'noop' flag)
		// then performs content based routing on the message using XPath
		from("ftp://rider@localhost:21000/order?password=secret&delete=true").to("log:camelinaction.order.ftp")
				.to("jms:incomingOrders");

		from("cxf:bean:orderEndpoint").log("log:camelinaction.order.ws").inOnly("jms:incomingOrders")
				.transform(constant("OK"));

		from("jms:incomingOrders").to("log:camelinaction.order.jms");

	}

}
